home *** CD-ROM | disk | FTP | other *** search
/ Developer CD Series 1996 February: Tool Chest / Apple Developer CD Series Tool Chest February 1996 (Apple Computer)(1996).iso / Tool Chest / Networking / SNMP / SNMP Development / MacSNMP Developer 1.0.2 / Tools / LinkSharedLibrary < prev    next >
Encoding:
Text File  |  1993-06-15  |  2.1 KB  |  77 lines  |  [TEXT/MPS ]

  1. #
  2. #    File:        LinkSharedLibrary
  3. #
  4. #    Contains:    Script to link a shared library
  5. #
  6. #    Copyright:    © 1992 by Apple Computer, Inc., all rights reserved.
  7. #
  8. #
  9.  
  10. Set Init        ""
  11. Set OutFile        ""
  12. Set Far            ""
  13. Set RezIn        ""
  14. Set InObj        ""
  15. Set Error        0
  16. If "{TempFolder}" != ""
  17.     Set Scratch "{TempFolder}"
  18. Else
  19.     Set Scratch "{CPlusScratch}"
  20. End
  21. LOOP
  22.     If "{1}" == "" || "{1}" !~ /-≈/
  23.         Break;
  24.     Else If "{1}" =~ /-link/
  25.         Shift; Break;
  26.     Else If "{1}" =~ /-far/
  27.         Set Far "{2}"; Shift 2; Continue
  28.     Else If "{1}" =~ /-init/
  29.         Set Init "{2}"; Shift 2; Continue
  30.     Else If "{1}" =~ /-obj/
  31.         Set InObj "{2}"; Shift 2; Continue
  32.     Else If "{1}" =~ /-rez/
  33.         Set RezIn "{2}"; Shift 2; Continue
  34.     Else If "{1}" =~ /-o/
  35.         Set OutFile "{2}";    Shift 2; Continue
  36.     Else
  37.         Set Error 1
  38.         Break;
  39.     End
  40.     Shift
  41. End
  42. If "{Init}" == "" || "{RezIn}" == "" || "{InObj}" == "" || "{OutFile}" == ""
  43.     Set Error 1
  44. End
  45. If {Error}
  46.         Echo "Usage: LinkSharedLibrary -o <OutFile>"
  47.         Echo "       -obj <OutputObjectFile> -init <LibraryInitObjectFile>"
  48.         Echo "       -rez <.libr Src Rez File> -far <FarClientFile>"
  49.         Echo "         -link"
  50.         Echo "        <LibsToLinkWith>"
  51.         Echo ""
  52.         Echo "Must be used after using MakeSharedClientFiles"
  53.         Echo ""
  54.         Echo "      Everything after -link will be passed to the linker directly."
  55.         Echo "      The list of libraries to link with must be last"
  56.         Echo "      or after the -link switch."
  57.         Echo "      The link automatically merges segments Main, STDCLIB, and SANELIB."
  58.         Exit 10
  59. End
  60. If {Progress}
  61.     Echo "∂t∂tCreating shared Library file ∂"{OutFile}∂""
  62. End
  63. Link -model far -srtsg all -d -t rsrc -c RSED -sn STDCLIB=Main -sn SANELIB=Main ∂
  64.     -sg %A5Init=A5Init -m DynamicCodeEntry -o "{Scratch}SLMTemp.RSRC" ∂
  65.     "{Init}" "{InObj}" "{Far}" ∂
  66.     {"Parameters"}
  67.  
  68. Duplicate -y "{RezIn}" "{Scratch}SLMTemp.temp.r"
  69. Echo "Include ∂"{Scratch}SLMTemp.RSRC∂" 'CODE' as SLMType;" >> "{Scratch}SLMTemp.temp.r"
  70. Echo "Delete SLMType (∂"32-bit bootstrap∂");" >> "{Scratch}SLMTemp.temp.r"
  71.  
  72. Delete -i "{OutFile}" ∑∑ Dev:Null
  73. Rez -a -t libr -c OMGR ∂
  74.     -o "{OutFile}" "{Scratch}SLMTemp.temp.r"
  75. SetFile -a ib "{OutFile}"
  76. delete -i "{Scratch}SLMTemp.temp.r" "{Scratch}SLMTemp.RSRC"
  77.